package com.example.micro.provider.controller;

import com.example.micro.provider.domain.User;
import com.example.micro.provider.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/p/user")
public class UserController {

    @Resource(name = "userService")
    private UserService userService;

    @GetMapping("/{id}")
    public User queryUserById(@PathVariable("id") Integer id) {
        return userService.queryUserById(id);
    }

}
